const Versions = new class{
    static getKey() {
        return `key_${new Date().getTime()}_${parseInt(Math.random() * 1000)}`;
    }
    constructor() {
        this.libs = {};
        this.keys = {};
        this.urls = {};
    }
    _merge_library_(pv,libs,url) {
        let _pv = `__python__${pv}`;
        let key = this.constructor.getKey();
        this.urls[key] = url;
        libs.push(new Library('python',pv));
        this.keys[key] = libs;
        libs.forEach(lib => {
            if (!(lib.name in this.libs)) {
                this.libs[lib.name] = {};
            }
            if (!(lib.minVersion in this.libs[lib.name])) {
                this.libs[lib.name][lib.minVersion] = [];
            }
            this.libs[lib.name][lib.minVersion].push(key);
        });
    }
    addLibrary(pythonVersion,libs,url) {
        url = url instanceof Array ? url : [url.toString()];
        if (pythonVersion instanceof Array) {
            pythonVersion.forEach(py => {
                this.addLibrary(py,libs,url);
            });
        } else {
            //
            this._merge_library_(pythonVersion,libs,url);
        }
    }
};
class Library {
    constructor(name,minVersion,maxVersion) {
        this.name = name.toLowerCase();
        this.minVersion = minVersion;
        this.maxVersion = maxVersion;
    }
}
Versions.addLibrary('3.6',[
    new Library('Matplotlib','3.3'),
    new Library('dateutil','2.1'),
    new Library('numpy','1.15'),
    new Library('pyparsing','2.0.3')
],'https://github.com/matplotlib/matplotlib/blob/6995c27f8a0c3a301e2e8943e0ce6e07186a190c/doc/api/prev_api_changes/api_changes_3.4.0/development.rst');
Versions.addLibrary('3.7',[
    new Library('Matplotlib','3.4'),
    new Library('dateutil','2.7'),
    new Library('numpy','1.16'),
    new Library('pyparsing','2.2.1'),
    new Library('tk','8.3'),
],['https://github.com/matplotlib/matplotlib/blob/ac3d0caf0007389579a5fa2576d95657b03d3f02/doc/api/next_api_changes/development/22205-ES.rst','https://github.com/matplotlib/matplotlib/blob/6995c27f8a0c3a301e2e8943e0ce6e07186a190c/doc/api/prev_api_changes/api_changes_3.5.0/development.rst']);
Versions.addLibrary('3.7',[
    new Library('Matplotlib','3.5'),
    new Library('numpy','1.17'),
    new Library('tk','8.4'),
],['https://github.com/matplotlib/matplotlib/blob/ac3d0caf0007389579a5fa2576d95657b03d3f02/doc/api/next_api_changes/development/22205-ES.rst','https://github.com/matplotlib/matplotlib/blob/6995c27f8a0c3a301e2e8943e0ce6e07186a190c/doc/api/prev_api_changes/api_changes_3.5.0/development.rst']);
Versions.addLibrary('3.8',[
    new Library('Matplotlib','3.6'),
    new Library('numpy','1.19'),
],'https://github.com/matplotlib/matplotlib/blob/ac3d0caf0007389579a5fa2576d95657b03d3f02/doc/api/next_api_changes/development/22205-ES.rst');
Versions.addLibrary('3.7',[
    new Library('scipy','1.7','1.8'),
    new Library('numpy','1.16.5'),
    new Library('pybind11','2.4.3'),
    new Library('sphinx','2.4.0','3.1.0'),
    new Library('scipy','1.8'),
    new Library('cython','0.29.18'),
],['https://github.com/scipy/scipy/blob/v1.7.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v1.8.0/INSTALL.rst.txt'])
Versions.addLibrary('3.7',[
    new Library('scipy','1.6'),
    new Library('numpy','1.16.5'),
    new Library('pybind11','2.4.3'),
    new Library('sphinx','1.2.1'),
    new Library('cython','0.29.18'),
],['https://github.com/scipy/scipy/blob/v1.6.0/INSTALL.rst.txt'])
Versions.addLibrary('3.6',[
    new Library('scipy','1.5'),
    new Library('numpy','1.14.5'),
    new Library('pybind11','2.4.3'),
    new Library('sphinx','1.2.1'),
    new Library('cython','0.29.18'),
],'https://github.com/scipy/scipy/blob/v1.5.0/INSTALL.rst.txt')
Versions.addLibrary('3.5',[
    new Library('scipy','1.3','1.4'),
    new Library('numpy','1.13.3'),
    new Library('pybind11','2.2.4'),
    new Library('sphinx','1.2.1'),
    new Library('cython','0.28.5'),
],['https://github.com/scipy/scipy/blob/v1.4.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v1.3.0/INSTALL.rst.txt'])
Versions.addLibrary(['3.4','2.7'],[
    new Library('scipy','0.19','1.2'),
    new Library('numpy','1.8.2'),
    new Library('sphinx','1.2.1'),
    new Library('cython','0.23.4'),
],['https://github.com/scipy/scipy/blob/v1.2.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v1.1.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v0.19.0/INSTALL.rst.txt'])
Versions.addLibrary(['3.4','2.7'],[
    new Library('scipy','0.18'),
    new Library('numpy','1.7.1'),
    new Library('sphinx','1.2.1'),
    new Library('cython','0.22'),
],['https://github.com/scipy/scipy/blob/v0.18.0/INSTALL.rst.txt'])
Versions.addLibrary(['2.6'],[
    new Library('scipy','0.16','0.17'),
    new Library('numpy','1.6.2'),
    new Library('sphinx','1.1.0'),
    new Library('cython','0.22'),
],['https://github.com/scipy/scipy/blob/v0.17.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v0.16.0/INSTALL.rst.txt'])
Versions.addLibrary(['2.6'],[
    new Library('scipy','0.14','0.15'),
    new Library('numpy','1.5.0'),
    new Library('sphinx','1.1.0'),
    new Library('cython','0.19'),
],['https://github.com/scipy/scipy/blob/v0.15.0/INSTALL.rst.txt','https://github.com/scipy/scipy/blob/v0.14.0/INSTALL.txt'])
Versions.addLibrary(['2.6'],[
    new Library('scipy','0.13'),
    new Library('numpy','1.5.0'),
    new Library('sphinx','1.1.0'),
],['https://github.com/scipy/scipy/blob/v0.13.0/INSTALL.txt'])
Versions.addLibrary(['2.6'],[
    new Library('scipy','0.12'),
    new Library('numpy','1.5.0'),
],['https://github.com/scipy/scipy/blob/v0.12.0/INSTALL.txt'])
Versions.addLibrary(['2.4'],[
    new Library('scipy','0.11'),
    new Library('numpy','1.5.0'),
],['https://github.com/scipy/scipy/blob/v0.11.0/INSTALL.txt'])
Versions.addLibrary(['2.4'],[
    new Library('scipy','0.7','0.10'),
    new Library('numpy','1.4.1'),
],['https://github.com/scipy/scipy/blob/v0.10.0/INSTALL.txt','https://github.com/scipy/scipy/blob/v0.9.0/INSTALL.txt','https://github.com/scipy/scipy/blob/v0.8.0/INSTALL.txt','https://github.com/scipy/scipy/blob/v0.7.0/INSTALL.txt'])

